using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class ListScipt : MonoBehaviour {
	
	public GUIStyle _unpurcahsedStyle;
	public GUIStyle _purcahsedStyle;
	public MainDisplay _mainDisplay;
	public SimpleTextDisplay [] _simpleDisplays;
	
	private Dictionary<Item, SimpleTextDisplay> _displayMap = new Dictionary<Item, SimpleTextDisplay>();
	private Dictionary<Item, bool> _itemMap = new Dictionary<Item, bool>();
	
	void Start() {
		//_mainDisplay.Render = false;	
	}
	
	public void BootShrap( Item [] items) {
		
		for (int count = 0; count < _simpleDisplays.Length && count < items.Length; count++) {
			_displayMap.Add (items[count], _simpleDisplays[count]);
			_itemMap.Add (items[count], false);
			_simpleDisplays[count]._text = items[count].name;
			
		}
		
	}
	
	public void PurchasedItem(Item i){
		_itemMap[i] = true;
		_displayMap[i]._textStyle = _purcahsedStyle;
	}
	
	public void UnpurchasedItem(Item i){
		_itemMap[i] = false;
		_displayMap[i]._textStyle = _unpurcahsedStyle;
	}
	
	
}
